package com.gem.mapper;

import com.gem.domain.CCrCompany;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import java.util.List;

/**
 * @author Apolar_GuanYH-管阳红
 * Description: 参与公司映射
 * create 2019/10/30 9:42
 * Modified By:
 */
@Mapper
public interface CCrCompanyMapper {

    //查询所有
    List<CCrCompany> selectAllCC();

    //按编号查询
    CCrCompany selectCCByid(Integer ccId);

    //按合作成果编号查询
    List<CCrCompany> selectCCByccCrId(Integer ccCrId);

    //按合作公司编号查询CrId
    @Select("SELECT cc_cr_id FROM c_cr_company WHERE cc_company_id=#{ccComId} AND cc_status>0")
    Integer[] selectCCByccCoId(Integer ccComId);

    //添加
    boolean addCC(CCrCompany cCrCompany);

    //伪删除
    @Update("UPDATE c_cr_company SET cc_status=-1 WHERE cc_id=#{ccId}")
    boolean deleteCCById(Integer ccId);

    //修改
    boolean modifyCC(CCrCompany cCrCompany);
}
